#include "CPlayListView.h"
#include <QMediaPlaylist>
#include <QScrollBar>
#include "GFPlayer.h"
#include <QStandardItem>

CPlayListView::CPlayListView(QWidget* parent)
	: QListView(parent)
{
	/*m_playlist = new QMediaPlaylist();
	m_playlistModel = new CPlaylistModel(this);*/
	/*this->setModel(m_playlistModel);
	this->setCurrentIndex(m_playlistModel->index(m_playlist->currentIndex(), 0));*/
	this->setStyleSheet("QListView{border:none;background-color:rgb(48, 48, 43);font-family: Microsoft YaHei;}"
		"QListView::item{font-size:12px;color:#999999;height:23px;border:none;padding-left:9px;}"
		"QListView::item:hover{background:#1d1d1d;color:#FFD200;border:0px;}"
		"QListView::item:focus{border:0px;background: none;}"
		"QListView::item:selected{ background:#1d1d1d;border:none;color:#FFD200}");
	this->horizontalScrollBar()->setVisible(false);
	this->setUniformItemSizes(true);

}

CPlayListView::~CPlayListView()
{
	//
}

int iiisd = 0;
void CPlayListView::addRowData()
{


	/*CPlaylistModel* pItemModel = new CPlaylistModel();
	QString strTemp = "hello world";
	pItemModel->setData(modelIndex, QVariant::fromValue(strTemp), Qt::UserRole);


	m_playlistModel->insertRow(0, pItemModel)*/

	// m_playlistModel->insertRow(0);

	QStandardItemModel* model = new QStandardItemModel(this);

	QString strTmp = QString("item %1").arg(iiisd++);

	QStandardItem* item = new QStandardItem(strTmp);
	model->appendRow(item);

	this->setModel(model);
}